//
//  ServerEngine.h
//  MobileOA
//
//  Created by chenxiaojuan on 13-4-16.
//  Copyright (c) 2013年 chenxiaojuan. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^CallbackBlock)(BOOL success,int code,NSString* desc,NSDictionary* data,NSDictionary* params);

@interface ServerEngine : NSObject

@property(nonatomic,retain)NSString* serverName;
@property(nonatomic,retain)NSString* serverProjectName;
@property(nonatomic,retain)NSString* serverPort;
@property(nonatomic,retain)NSString* serverUri;

+(NSDictionary*)decodeCmd:(NSString*)cmd_string;
+(BOOL)removeRequestCache:(NSString*)name params:(NSDictionary*)params;

+(NSString *)encryptDES:(NSString *)plainText key:(NSString *)key;
+(NSString *)decryptDES:(NSString *)cipherText key:(NSString *)key;


-(NSDictionary*)serverCall:(NSString*)name params:(NSDictionary*)params callback:(CallbackBlock)callback;
-(NSDictionary*)serverCall:(NSString*)name params:(NSDictionary*)params callback:(CallbackBlock)callback needCache:(BOOL)needCache;


@end
